{ INFORMATICS.MCCME.RU
  Problem statement: http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=1526
  Verdict: Accepted
}
uses 
	SysUtils, Math;
 
var
	i,n,k,ca,ans:longint;
 
begin
reset(input,'input.txt');
rewrite(output,'output.txt');
read(n);
ca:=maxlongint;
ans:=0;
for i:=1 to n do begin
	read(k);
	if k=ca then inc(ans) else 
	if k<ca then begin
		ca:=k;
		ans:=1;
	end;
end;
write(ans);
end.